home *** CD-ROM | disk | FTP | other *** search
-
- \ **********************************************************************
- \
- \ ***************************************
- \ HeliOS GraphicsLib Multi-scroll Example
- \ ***************************************
- \
- \ This short example allows you to experiment with the GraphicsLib multi-
- \ scroll functions by giving you a framework of code into which you can
- \ place different parameters.
- \
- \ **********************************************************************
-
- FORGET **CORE**
-
- CREATEL SCROLLSTRUCT1
-
- FRPORT D, \ Pointer to the RastPort containing the scroll area.
- 32 , \ Scroll top left corner horizontal pixel position.
- 80 , \ Scroll top left corner vertical pixel position.
- 100 , \ Scroll pixel width.
- 50 , \ Scroll pixel height.
- -1 , \ Scroll plane useage mask.
- 1 , \ Horizontal background fill flag.
- 1 , \ Vertical background fill flag.
- 0 , \ External user-code horizontal fill for 1st scroll.
- 0 , \ External user-code vertical fill for 1st scroll.
- 0 , \ External user-code horizontal fill for repeat scrolls.
- 0 , \ External user-code vertical fill for repeat scrolls.
- 0 , \ Reserved.
- 0 , \ Specifies blitwait video beam position.
- 0 , \ Reserved.
-
- CREATEL SCROLLSTRUCT2
-
- FRPORT D, \ Pointer to the RastPort containing the scroll area.
- 185 , \ Scroll top left corner horizontal pixel position.
- 150 , \ Scroll top left corner vertical pixel position.
- 100 , \ Scroll pixel width.
- 50 , \ Scroll pixel height.
- -1 , \ Scroll plane useage mask.
- 1 , \ Horizontal background fill flag.
- 1 , \ Vertical background fill flag.
- 0 , \ External user-code horizontal fill for 1st scroll.
- 0 , \ External user-code vertical fill for 1st scroll.
- 0 , \ External user-code horizontal fill for repeat scrolls.
- 0 , \ External user-code vertical fill for repeat scrolls.
- 0 , \ Reserved.
- 0 , \ Specifies blitwait video beam position.
- 0 , \ Reserved.
-
- CREATEL SCROLLSTRUCT3
-
- FRPORT D, \ Pointer to the RastPort containing the scroll area.
- 350 , \ Scroll top left corner horizontal pixel position.
- 80 , \ Scroll top left corner vertical pixel position.
- 100 , \ Scroll pixel width.
- 50 , \ Scroll pixel height.
- -1 , \ Scroll plane useage mask.
- 1 , \ Horizontal background fill flag.
- 1 , \ Vertical background fill flag.
- 0 , \ External user-code horizontal fill for 1st scroll.
- 0 , \ External user-code vertical fill for 1st scroll.
- 0 , \ External user-code horizontal fill for repeat scrolls.
- 0 , \ External user-code vertical fill for repeat scrolls.
- 0 , \ Reserved.
- 0 , \ Specifies blitwait video beam position.
- 0 , \ Reserved.
-
- CREATEL SCROLLSTRUCT4
-
- FRPORT D, \ Pointer to the RastPort containing the scroll area.
- 494 , \ Scroll top left corner horizontal pixel position.
- 150 , \ Scroll top left corner vertical pixel position.
- 100 , \ Scroll pixel width.
- 50 , \ Scroll pixel height.
- -1 , \ Scroll plane useage mask.
- 1 , \ Horizontal background fill flag.
- 1 , \ Vertical background fill flag.
- 0 , \ External user-code horizontal fill for 1st scroll.
- 0 , \ External user-code vertical fill for 1st scroll.
- 0 , \ External user-code horizontal fill for repeat scrolls.
- 0 , \ External user-code vertical fill for repeat scrolls.
- 0 , \ Reserved.
- 0 , \ Specifies blitwait video beam position.
- 0 , \ Reserved.
-
- 0. DVARIABLE SCROLLDATA1
- 0. DVARIABLE SCROLLDATA2
- 0. DVARIABLE SCROLLDATA3
- 0. DVARIABLE SCROLLDATA4
-
- : DrawBevelBox
-
- D>R
- DI 4. D+ @L 4 - \ LeftEdge(w)
- DI 6. D+ @L 2- \ TopEdge(w)
- DI 8. D+ @L 8 + \ Width(w)
- DR> 10. D+ @L 4 + \ Height(w)
- 6 \ HiPen(w)
- 6 \ LoPen(w)
- 1 \ Outline Colour(w)
- 1 \ Bevel Width(w)
- -1 \ Inner Rectangle Colour(w)
- -1 \ Inner Rectangle Outline Colour(w)
- 0 \ Inner Rectangle X-Inset ->(w)
- 0 \ Inner Rectangle X-Inset <-(w)
- 0 \ Inner Rectangle Y-Inset ^ (w)
- 0 \ Inner Rectangle Y-Inset Down(w)
- FRPORT \ RPort(l)
- 36 GADGETLIB \ SETBOX
- 35 GADGETLIB \ DRAWDUMMY
- ;
-
- : SCROLLTEST
-
- SCRCLR
- 2 BPENSET
- 2 2 CURPUT
-
- SCROLLSTRUCT1 31 GRAPHICSLIB \ SETUPSCROLL
- DDUP SCROLLDATA1 D!
- D0<>
-
- SCROLLSTRUCT2 31 GRAPHICSLIB \ SETUPSCROLL
- DDUP SCROLLDATA2 D!
- D0<>
- AND
-
- SCROLLSTRUCT3 31 GRAPHICSLIB \ SETUPSCROLL
- DDUP SCROLLDATA3 D!
- D0<>
- AND
-
- SCROLLSTRUCT4 31 GRAPHICSLIB \ SETUPSCROLL
- DDUP SCROLLDATA4 D!
- D0<>
- AND
-
- IF
- 1 FPENSET
- ." Press any key to scroll, and <Esc> to quit"
-
- 1 4 CURPUT
-
- 19 0
- DO
- ." Let's have something here to scroll! "
- ." Let's have something here to scroll! "
- CR
- LOOP
-
- 1 32 GADGETLIB \ Hires pixel shape
-
- SCROLLSTRUCT1 DrawBevelBox
- SCROLLSTRUCT2 DrawBevelBox
- SCROLLSTRUCT3 DrawBevelBox
- SCROLLSTRUCT4 DrawBevelBox
-
- BEGIN
- KEY
- 27 =
- IF
- 1
- ELSE
-
- SCROLLDATA1 D@ \ Area 1
- 1 \ Number of iterations
- -1 \ Horizontal scroll
- 2 \ Vertical scroll
- 32 GRAPHICSLIB \ SCROLLIT -> Area 1
-
- SCROLLDATA2 D@ \ Area 2
- 1 \ Number of iterations
- 1 \ Horizontal scroll
- -1 \ Vertical scroll
- 32 GRAPHICSLIB \ SCROLLIT -> Area 2
-
- SCROLLDATA3 D@ \ Area 3
- 1 \ Number of iterations
- -1 \ Horizontal scroll
- -2 \ Vertical scroll
- 32 GRAPHICSLIB \ SCROLLIT -> Area 3
-
- SCROLLDATA4 D@ \ Area 4
- 1 \ Number of iterations
- 1 \ Horizontal scroll
- 1 \ Vertical scroll
- 32 GRAPHICSLIB \ SCROLLIT -> Area 4
-
- 0
- THEN
- UNTIL
-
- ELSE
- 6 FPENSET
- ." Allocation failed! Press <Space> to quit!" WAITSPACE
- THEN
-
- SCROLLDATA4 D@ 33 GRAPHICSLIB \ FREESCRLDATA
- SCROLLDATA3 D@ 33 GRAPHICSLIB \ FREESCRLDATA
- SCROLLDATA2 D@ 33 GRAPHICSLIB \ FREESCRLDATA
- SCROLLDATA1 D@ 33 GRAPHICSLIB \ FREESCRLDATA
-
- SCRCLR
- ;
-
- SCROLLTEST
-